<template>
  <el-form-item :label="label">
    <button
      type="button"
      @click="innerVisible = true"
      class="btn btn-info el-form-item__label text-white"
      style="width:100px"
    >选取图片</button>
    <slot></slot>
    <el-dialog width="80%" title="选取图片" :visible.sync="innerVisible" append-to-body>
      <ossImglist v-bind:selected="selected"></ossImglist>
    </el-dialog>
  </el-form-item>
</template>

<script>
import ossImglist from "@/components/newpublic/oss.vue";
export default {
  name: "getfile",
  data() {
    return {
      innerVisible: false
    };
  },
  props: {
    label: {
      type: String,
      default: "选取文件"
    }
  },
  methods: {
    selected(v) {
      this.innerVisible = false;
      this.$attrs.selected(v);
    }
  },
  components: {
    ossImglist
  }
};
</script>

<style scoped>
</style>

